/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upn.sigemfi.ope.be;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *
 * @author infzt
 */
@Entity
@Table(name = "OPE_VENTANILLA", catalog = "SIGEMFI", schema = "dbo")
@NamedQueries({@NamedQuery(name = "Ventanilla.findAll", query = "SELECT v FROM Ventanilla v"), @NamedQuery(name = "Ventanilla.findByIdVentanilla", query = "SELECT v FROM Ventanilla v WHERE v.idVentanilla = :idVentanilla")})
public class Ventanilla implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID_VENTANILLA", nullable = false)
    private Long idVentanilla;
    @OneToMany(mappedBy = "fidOpeVentanilla", fetch = FetchType.LAZY)
    private List<Efectivo> efectivoCollection;
    @OneToOne(cascade = CascadeType.ALL, mappedBy = "fidOpeVentanilla", fetch = FetchType.LAZY)
    private Boveda boveda;

    public Ventanilla() {
    }

    public Ventanilla(Long idVentanilla) {
        this.idVentanilla = idVentanilla;
    }

    public Long getIdVentanilla() {
        return idVentanilla;
    }

    public void setIdVentanilla(Long idVentanilla) {
        this.idVentanilla = idVentanilla;
    }

    public List<Efectivo> getEfectivoCollection() {
        return efectivoCollection;
    }

    public void setEfectivoCollection(List<Efectivo> efectivoCollection) {
        this.efectivoCollection = efectivoCollection;
    }

    public Boveda getBoveda() {
        return boveda;
    }

    public void setBoveda(Boveda boveda) {
        this.boveda = boveda;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idVentanilla != null ? idVentanilla.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Ventanilla)) {
            return false;
        }
        Ventanilla other = (Ventanilla) object;
        if ((this.idVentanilla == null && other.idVentanilla != null) || (this.idVentanilla != null && !this.idVentanilla.equals(other.idVentanilla))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "edu.upn.sigemfi.ope.be.Ventanilla[idVentanilla=" + idVentanilla + "]";
    }

}
